#!/bin/bash
OUT_DIR=`echo $1 | awk -F. '{print $1}'`
# LAST_FRAME=`./swfdump -t $1 | grep SHOWFRAME | tail -n1 | awk '{print $4}'`
LAST_FRAME=`./swfdump -f $1 | awk '{print $2}'`
mkdir $OUT_DIR
while [ $LAST_FRAME -gt 0 ]; do
	 let LAST_FRAME=LAST_FRAME-1
	 ./swfextract -f $LAST_FRAME -o $OUT_DIR/$LAST_FRAME.swf $1
done
